package ru.ifmo.kis.domain;

import java.util.Map;

/**
 *
 * @author ivan
 */
public class Product {

    public static final int CHANGEOVER_TIME = 1;

    private String name;
    private int duration;
    private Map<Material, Integer> recipe;
    private int id;

    public Product(int id, String name, int duration, Map<Material, Integer> recipe) {
        this.id = id;
        this.name = name;
        this.duration = duration;
        this.recipe = recipe;
    }



    public int getDuration() {
        return duration;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Product other = (Product) obj;
        if ((this.name == null) ? (other.name != null) : !this.name.equalsIgnoreCase(other.name)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 13 * hash + (this.name != null ? this.name.toUpperCase().hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return name;
    }

    public int getId() {
        return id;
    }
}
